﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace CPPEI.Coolzon.Designer.Views
{
    public static class SwitchWorkSpaceCommand
    {
        public static void Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (SolutionTreeViewNodeHelper.IsCancelSaveOrUnSaveCurrentSceneOperation())
            {
                return;
            }
            WorkSpaceSelectView workSpace = new WorkSpaceSelectView();
            bool? res = workSpace.ShowDialog();
            if (res.Value)
            {
                Event.UI.UIEventBus.Publish(new Event.UI.UISwitchWorkSpaceEvent());
            }
        }
        public static void CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = true;
        }
    }
}
